// let url = 'http://www.xxxx.com:3000/api/addname?id=1&bookname=asdf';
// let u = new URL(url);
// console.log(u);
//==========================相关问题=================
let u = new URL('/api/delbook?id=2','http://www.xx.com');
console.log(u); //报错,u不是完整的url 需要补充成完整的url,可以写在第二个参数上

// 获取参数
let p = new URLSearchParams('?id=2');
console.log(p.get('id'));
